﻿package com.winmastergames.lolgame.powerups {
	import com.winmastergames.lolgame.engine;
	import com.winmastergames.lolgame.globals;
	import com.winmastergames.lolgame.mapDefault;
	import com.winmastergames.lolgame.powerups.*;
	import com.winmastergames.lolgame.enemys.base;

	public class powerUpSpawner {

		public function powerUpSpawner(){
		}

		public static function spawnPowerUp(X:Number, Y:Number, powerup:String){
			switch (powerup){
				case "damage":
					if (globals.damageThisRound < globals.maxDamageThisRound){
						engine.powerupsArrayRO.push(new damage(X, Y, engine.st_level_mc));
						globals.damageThisRound++;
					}
					break;
				case "insta":
					if (globals.instaThisRound < globals.maxInstaThisRound){
						engine.powerupsArrayRO.push(new instakill(X, Y, engine.st_level_mc));
						globals.instaThisRound++;
					}
					break;
				case "ammo":
					if (globals.ammoThisRound < globals.maxAmmoThisRound){
						engine.powerupsArrayRO.push(new ammo(X, Y, engine.st_level_mc));
						globals.ammoThisRound++;
					}
					break;
				case "repair":
					if (globals.repairThisRound < globals.maxRepairThisRound){
						engine.powerupsArrayRO.push(new repair(X, Y, engine.st_level_mc));
						globals.repairThisRound++;
					}
					break;
				case "inv":
					if (globals.invThisRound < globals.maxInvThisRound){
						engine.powerupsArrayRO.push(new invincibility(X, Y, engine.st_level_mc));
						globals.invThisRound++;
					}
					break;
			}
		}
	}
}